﻿using UnityEngine;
using System.Collections;
using Helper;
public class PlatformMove : MonoBehaviour {
	[SerializeField] string pathName;
	[SerializeField] float moveSpeed = 3f;
	OnePath path;

	[SerializeField] bool restart = false;
	void Start () {
		//Movement.MoveAlongTweenCurves (target, path.Path, totalTime);
		path = PathsManager._instance.GetPathOfName(pathName);
		if (path != null) {
			Movement.MoveAlongLines(gameObject, path.Path, moveSpeed, true);
		}
	}

	void Update () {
		if (restart) {
			restart = false;
			Movement.MoveAlongLines(gameObject, path.Path, moveSpeed, true);
		}
	}
}
